*Does School Debating Reduce Vulnerability to Misinformation? A Field Experiment in Poland
*Authors: Krzysztof Krakowski, Bernhard Clemm von Hohenberg, Davide Morisi
*Journal: The Journal of Politics

*This file replicates the following:
*Figure D1 in Appendix D

*31 January 2025

*working directory
cd "[insert your directory]"

*open data
use "data/misinformation_completion_by_school.dta", clear


*********

*
*Figure D1. Completion rate by city
egen sum = sum(count)
gen weight = count/sum
ssc instal _gwtmean // Package necessary to compute the weighted mean (line below) 
bys city: egen completed_weighted = wtmean(completed), weight(weight)
* In some versions of Stata the weighted mean needs to be created using the below code: 
* ssc instal _gwmean // Alternative package necessary to compute the weighted mean (line below) 
* bys city: egen completed_weighted = wmean(completed), weight(weight)
graph bar completed_weighted , over(city) ytitle("Completion rate (weighted)")

